<template>
	<view class="content">
		<view class="pageHeader">
			数字协议
			<a class="generalBack" @click="backpage()" hover-class="none">
			 <image src="/static/b-1.png" style="width: 18upx;height: 30upx;"></image>
			 </a>
		</view>
		<view class="regoodbox">
			<view v-if="xieyi" class="empty">
				<image src="/static/empty.png" mode="widthFix"></image>
				<view class="empty-tips">
					暂无文件~
				</view>
			</view>
			<view v-else v-html="intro">
				
			</view>
		</view>
		<view class="customer">
			<view class="reading" @click="backpage">我已充分阅读</view>
		</view>
	</view>
	</template>
	<script>
	import postAjax from '../../API/postAjax.js'
	export default {
		data() {
			return {
				userToken:'',// token
				xieyi:false,
				intro:'',
				fileId:''
			}
		},
		onLoad(options) {
			let that = this
			that.userToken = uni.getStorageSync('token')
			that.fileId =options.id
			console.log(that.fileId)
			that.getmsg(that.fileId)
		},
		methods: {
			// 返回上一页
			backpage(){
				uni.navigateBack({
					delta:1
				})
			},
			// 获取文件夹详情
			getmsg(id){
				let that = this
				postAjax('file/fileInfo',{id:id,token:that.userToken},function(data){
					that.intro = data.data[0].file_introduce
				})
			}
		}
	}
	
</script>

<style>
	.content{min-height: 100vh;background-color: #fff;}
	
	.pageHeader{position: fixed;top:0;left:0;z-index:999;width: 100%;height: 128upx;background-color: #1D84E8;line-height: 128upx;text-align: center;font-size: 36upx;color: #fff;padding-top: 40upx;}
	.generalBack{position: absolute;top:40upx;left:30upx;display: block;}
	.regoodbox{padding: 180upx 30upx 120upx;}
	.customer{position: fixed;width: 100%;left: 0;bottom: 0;z-index:999;padding: 14upx 0 ;border-top:2upx solid #eee;height: 80upx;background-color: #fff;}
	.reading{width: 382upx;background-color: #1D84E8;color: #fff;font-size: 30upx;border-radius:10upx;margin: 0 auto;text-align: center;height: 72upx;line-height: 72upx;}
	.empty {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100vh;
		padding-bottom: 100upx;
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
		background: #fff;
	
	}
	
	.empty image {
		width:240upx;
		margin-bottom: 30upx;
	}
	.empty-tips {
		display: flex;
		font-size: 30upx;
		color: #666;
	
	}
</style>
